//
//  CycleImageViewController.m
//  Beauty
//
//  Created by Snow on 16/9/8.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "CycleImageViewController.h"

@interface CycleImageViewController ()

@end

@implementation CycleImageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:web];
    NSString *urlStr = _model.adv_pic_url;
    if (![_model.adv_pic_url hasPrefix:@"http://"]) {
        urlStr = [NSString stringWithFormat:@"http://%@", _model.adv_pic_url];
    }
    NSURL *url = [NSURL URLWithString:urlStr];
    // 2. 把URL告诉给服务器,请求,从m.baidu.com请求数据
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    web.scalesPageToFit = YES; //设置网页自动适应
    web.dataDetectorTypes = UIDataDetectorTypeAll; //设置检测网页中的格式类型，all表示检测所有类型包括超链接、电话号码、地址等。
    [web loadRequest:request];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
